﻿<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<NDepot.Models.UI.Cart>" %>

<div class="cart-title">Your Cart</div>
<table>

<% foreach (var item in Model.Items.Values) { %>
<% if (item == Model.CurrentItem) { %>
    <tr id="current_item" class="current_item">
<% } else { %>
    <tr>
<% } %>
<td><%: item.Quantity %>&times;</td>
<td><%: item.Title %></td>
<td class="item-price"><%: item.Price %></td>
</tr>
<% } %>

<tr class="total-line">
<td colspan="2">Total</td>
<td class="total-cell"><%: Model.TotalPrice %></td>
</tr>
</table>

<form method="get" action="/Store/CheckOut/" class="button-to">
    <input type="submit" value="CheckOut" />
</form>
<form method="get" action="/Store/EmptyCart/" class="button-to">
    <input type="submit" value="Empty Cart" />
</form>